//===============================================================================
// Microsoft Architecture Strategy Team
// LitwareHR - SaaS Sample Application
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================



using System;
using System.Collections.Generic;
using System.Text;
using LitwareHR.Recruiting.Contract;
using LitwareHR.Portfolio.Gateways;
using Shp.Runtime.Contract;

namespace LitwareHR.PublicApp.Presenters.Careers.Recruiting
{
    public class ResumePresenter
    {
        IResumeView _view;

        public ResumePresenter(IResumeView view)
        {
            _view = view;
        }

        public void OnSubmit(Resume resume)
        {
            RecruitingGateway.SubmitResume(resume);
            RecruitingGateway.AddVideoResume(resume);
        }

        public void OnViewLoaded(string tenantAlias)
        {
            _view.SetValidators();
            _view.SetDefaultValues();
            SilverlightAccount silverLigth = RecruitingGateway.GetSilverlightAccount();
            bool isVisible = silverLigth != null;
            _view.ShowVideoPanel(isVisible);
            _view.BuildEntityForm(DatamodelGateway.GetEntityDefFields(tenantAlias, Constants.Entity.Position));
        }

        public void OnDemoLinkClicked()
        {
            _view.DemoOnlyFillBasicApplication("Your Name", "Your Last Name", "Your address", "425-000-0000", 
                                               "Resume\n------\nName: My Name\nLast Name: My Last Name\nInterests\n----------\nHere are some of my interests." );
        }
    }
}
